home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / polyCreateFacetValues.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.0 KB  |  103 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // this proc points the tool properties
  19. // window to the current polyCreateFacet context
  20.  
  21. global proc callPolyCreateFacetCtx(string $in, string $toolName)
  22. {
  23.     if ($in == "Normalize") $inval = 1;
  24.     else if ($in == "Unitize") $inval = 2;
  25.     else $inval = 0;    // Default should go here.
  26.     eval("polyCreateFacetCtx -e -tx " + $inval + " " + $toolName);
  27. }
  28.  
  29. global proc changeMaxPointsValueCreate(int $val, string $toolName)
  30. {
  31.     if ($val < 3)
  32.     {
  33.         $val = -1;
  34.         intSliderGrp -e -v $val maxPointsSlider;
  35.         disable -v false subdSld;
  36.     }
  37.     else {
  38.         polyCreateFacetCtx -e -s 1 $toolName;    
  39.         intSliderGrp -e -v 1 subdSld;
  40.         disable subdSld;
  41.     }
  42.     eval("polyCreateFacetCtx -e -mp " + $val + " " + $toolName);
  43. }
  44.  
  45. global proc polyCreateFacetValues ( string $toolName )
  46. {
  47.     string $name = "polyCreateFacet";
  48.     string $parent = (`toolPropertyWindow -q -location` + "|" + $name);
  49.     setParent $parent;
  50.  
  51.     // operation
  52.     //
  53.     int $mode = `polyCreateFacetCtx -q -ap $toolName`;
  54.     if( $mode )
  55.         radioButtonGrp -e -sl 2 newFacetRadio; // append
  56.     else
  57.         radioButtonGrp -e -sl 1 newFacetRadio; // create
  58.     radioButtonGrp -e
  59.         -on1 ("polyCreateFacetCtx -e -ap false " +$toolName)
  60.         -on2 ("polyCreateFacetCtx -e -ap true "  +$toolName)
  61.         newFacetRadio;
  62.     
  63.     // Subdivisions
  64.     //
  65.     intSliderGrp -e
  66.         -v  `polyCreateFacetCtx -q -s $toolName`
  67.         -cc ("polyCreateFacetCtx -e -s #1 " +$toolName)
  68.         subdSld;
  69.     int $maxP = `polyCreateFacetCtx -q -mp $toolName`;
  70.     if ($maxP < 3)
  71.         disable -v false subdSld;
  72.     else
  73.         disable subdSld;
  74.  
  75.     // Max points
  76.     intSliderGrp -e
  77.         -v `polyCreateFacetCtx -q -mp $toolName`
  78.         -cc ("changeMaxPointsValueCreate #1 " + $toolName)
  79.         maxPointsSlider;            
  80.  
  81.     // Texture
  82.     //
  83.     //checkBox -e
  84.  
  85.     int    $val = `polyCreateFacetCtx -q -tx $toolName` + 1;
  86.     optionMenuGrp -edit 
  87.         -sl $val
  88.         -cc ("callPolyCreateFacetCtx #1 " +$toolName)
  89.         textureBox;
  90.     
  91.     // Planar constraint
  92.     //
  93.     checkBoxGrp -e
  94.         -value1   `polyCreateFacetCtx -q -pc $toolName`
  95.         -on1 togglePolyPlanarConstraints
  96.         -of1 togglePolyPlanarConstraints
  97.         planarBox;
  98.  
  99.     string $helpTag= "CreatePolygonTool";
  100.     toolPropertySetCommon $toolName ($name + ".xpm") $helpTag;
  101.     toolPropertySelect $name;
  102. }
  103.